<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Iterator</title>
</head>
<body>
  <script>
    const a = ["foo", "bar", "baz", "qux"];

    const aKeys = Array.from(a.keys());
    const aValues = Array.from(a.values());
    const aEntries = Array.from(a.entries());

    console.log(aKeys);
    console.log(aValues);
    console.log(aEntries);

    for (const [idx, element] of a.entries()) {
      console.log(idx);
      console.log(element);
    }
  </script>
</body>
</html>